#!/bin/python3
# -*- coding:utf-8 -*-
"""
    控制
    By :陈狍子 e4ting@qq.com 2024-12-14 17:50:23
"""
import sys,os
from pdb import set_trace as strace
from traceback  import format_exc as dumpstack
# from e4ting import util,log

from .wamp import WAMP

class Caller(object):
    """ RPC Caller """
    def __init__(self, uid):
        self.uid = uid
        self.rpc = WAMP(self.uid)

    def bet(self, minimal=""):
        # 函数调用
        uri = "e4ting.{self.uid}.bet".format(self=self)
        ret = self.rpc.call(uri, minimal)
        return ret

    def dealcards(self, cards=[]):
        # 函数调用
        uri = "e4ting.{self.uid}.dealcards".format(self=self)
        ret = self.rpc.call(uri, cards)
        return ret

    def show(self, message=""):
        # 函数调用
        uri = "e4ting.{self.uid}.show".format(self=self)
        ret = self.rpc.call(uri, message)
        return ret

    def update(self, link=""):
        # 函数调用
        uri = "e4ting.{self.uid}.update".format(self=self)
        ret = self.rpc.call(uri, link)
        return ret

